{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { DEFAULT_MODE_STORAGE_KEY, DEFAULT_COLOR_SCHEME_STORAGE_KEY } from './getInitColorSchemeScript';\nexport function getSystemMode(mode) {\n  if (typeof window !== 'undefined' && mode === 'system') {\n    const mql = window.matchMedia('(prefers-color-scheme: dark)');\n    if (mql.matches) {\n      return 'dark';\n    }\n    return 'light';\n  }\n  return undefined;\n}\nfunction processState(state, callback) {\n  if (state.mode === 'light' || state.mode === 'system' && state.systemMode === 'light') {\n    return callback('light');\n  }\n  if (state.mode === 'dark' || state.mode === 'system' && state.systemMode === 'dark') {\n    return callback('dark');\n  }\n  return undefined;\n}\nexport function getColorScheme(state) {\n  return processState(state, mode => {\n    if (mode === 'light') {\n      return state.lightColorScheme;\n    }\n    if (mode === 'dark') {\n      return state.darkColorScheme;\n    }\n    return undefined;\n  });\n}\nfunction initializeValue(key, defaultValue) {\n  if (typeof window === 'undefined') {\n    return undefined;\n  }\n  let value;\n  try {\n    value = localStorage.getItem(key) || undefined;\n    if (!value) {\n      // the first time that user enters the site.\n      localStorage.setItem(key, defaultValue);\n    }\n  } catch (e) {\n    // Unsupported\n  }\n  return value || defaultValue;\n}\nexport default function useCurrentColorScheme(options) {\n  const {\n    defaultMode = 'light',\n    defaultLightColorScheme,\n    defaultDarkColorScheme,\n    supportedColorSchemes = [],\n    modeStorageKey = DEFAULT_MODE_STORAGE_KEY,\n    colorSchemeStorageKey = DEFAULT_COLOR_SCHEME_STORAGE_KEY,\n    storageWindow = typeof window === 'undefined' ? undefined : window\n  } = options;\n  const joinedColorSchemes = supportedColorSchemes.join(',');\n  const [state, setState] = React.useState(() => {\n    const initialMode = initializeValue(modeStorageKey, defaultMode);\n    const lightColorScheme = initializeValue(`${colorSchemeStorageKey}-light`, defaultLightColorScheme);\n    const darkColorScheme = initializeValue(`${colorSchemeStorageKey}-dark`, defaultDarkColorScheme);\n    return {\n      mode: initialMode,\n      systemMode: getSystemMode(initialMode),\n      lightColorScheme,\n      darkColorScheme\n    };\n  });\n  const colorScheme = getColorScheme(state);\n  const setMode = React.useCallback(mode => {\n    setState(currentState => {\n      if (mode === currentState.mode) {\n        // do nothing if mode does not change\n        return currentState;\n      }\n      const newMode = !mode ? defaultMode : mode;\n      try {\n        localStorage.setItem(modeStorageKey, newMode);\n      } catch (e) {\n        // Unsupported\n      }\n      return _extends({}, currentState, {\n        mode: newMode,\n        systemMode: getSystemMode(newMode)\n      });\n    });\n  }, [modeStorageKey, defaultMode]);\n  const setColorScheme = React.useCallback(value => {\n    if (!value) {\n      setState(currentState => {\n        try {\n          localStorage.setItem(`${colorSchemeStorageKey}-light`, defaultLightColorScheme);\n          localStorage.setItem(`${colorSchemeStorageKey}-dark`, defaultDarkColorScheme);\n        } catch (e) {\n          // Unsupported\n        }\n        return _extends({}, currentState, {\n          lightColorScheme: defaultLightColorScheme,\n          darkColorScheme: defaultDarkColorScheme\n        });\n      });\n    } else if (typeof value === 'string') {\n      if (value && !joinedColorSchemes.includes(value)) {\n        console.error(`\\`${value}\\` does not exist in \\`theme.colorSchemes\\`.`);\n      } else {\n        setState(currentState => {\n          const newState = _extends({}, currentState);\n          processState(currentState, mode => {\n            try {\n              localStorage.setItem(`${colorSchemeStorageKey}-${mode}`, value);\n            } catch (e) {\n              // Unsupported\n            }\n            if (mode === 'light') {\n              newState.lightColorScheme = value;\n            }\n            if (mode === 'dark') {\n              newState.darkColorScheme = value;\n            }\n          });\n          return newState;\n        });\n      }\n    } else {\n      setState(currentState => {\n        const newState = _extends({}, currentState);\n        const newLightColorScheme = value.light === null ? defaultLightColorScheme : value.light;\n        const newDarkColorScheme = value.dark === null ? defaultDarkColorScheme : value.dark;\n        if (newLightColorScheme) {\n          if (!joinedColorSchemes.includes(newLightColorScheme)) {\n            console.error(`\\`${newLightColorScheme}\\` does not exist in \\`theme.colorSchemes\\`.`);\n          } else {\n            newState.lightColorScheme = newLightColorScheme;\n            try {\n              localStorage.setItem(`${colorSchemeStorageKey}-light`, newLightColorScheme);\n            } catch (error) {\n              // Unsupported\n            }\n          }\n        }\n        if (newDarkColorScheme) {\n          if (!joinedColorSchemes.includes(newDarkColorScheme)) {\n            console.error(`\\`${newDarkColorScheme}\\` does not exist in \\`theme.colorSchemes\\`.`);\n          } else {\n            newState.darkColorScheme = newDarkColorScheme;\n            try {\n              localStorage.setItem(`${colorSchemeStorageKey}-dark`, newDarkColorScheme);\n            } catch (error) {\n              // Unsupported\n            }\n          }\n        }\n        return newState;\n      });\n    }\n  }, [joinedColorSchemes, colorSchemeStorageKey, defaultLightColorScheme, defaultDarkColorScheme]);\n  const handleMediaQuery = React.useCallback(e => {\n    if (state.mode === 'system') {\n      setState(currentState => _extends({}, currentState, {\n        systemMode: e != null && e.matches ? 'dark' : 'light'\n      }));\n    }\n  }, [state.mode]);\n\n  // Ref hack to avoid adding handleMediaQuery as a dep\n  const mediaListener = React.useRef(handleMediaQuery);\n  mediaListener.current = handleMediaQuery;\n  React.useEffect(() => {\n    const handler = function () {\n      return mediaListener.current(...arguments);\n    };\n\n    // Always listen to System preference\n    const media = window.matchMedia('(prefers-color-scheme: dark)');\n\n    // Intentionally use deprecated listener methods to support iOS & old browsers\n    media.addListener(handler);\n    handler(media);\n    return () => media.removeListener(handler);\n  }, []);\n\n  // Handle when localStorage has changed\n  React.useEffect(() => {\n    const handleStorage = event => {\n      const value = event.newValue;\n      if (typeof event.key === 'string' && event.key.startsWith(colorSchemeStorageKey) && (!value || joinedColorSchemes.match(value))) {\n        // If the key is deleted, value will be null then reset color scheme to the default one.\n        if (event.key.endsWith('light')) {\n          setColorScheme({\n            light: value\n          });\n        }\n        if (event.key.endsWith('dark')) {\n          setColorScheme({\n            dark: value\n          });\n        }\n      }\n      if (event.key === modeStorageKey && (!value || ['light', 'dark', 'system'].includes(value))) {\n        setMode(value || defaultMode);\n      }\n    };\n    if (storageWindow) {\n      // For syncing color-scheme changes between iframes\n      storageWindow.addEventListener('storage', handleStorage);\n      return () => storageWindow.removeEventListener('storage', handleStorage);\n    }\n    return undefined;\n  }, [setColorScheme, setMode, modeStorageKey, colorSchemeStorageKey, joinedColorSchemes, defaultMode, storageWindow]);\n  return _extends({}, state, {\n    colorScheme,\n    setMode,\n    setColorScheme\n  });\n}","map":{"version":3,"names":["_extends","React","DEFAULT_MODE_STORAGE_KEY","DEFAULT_COLOR_SCHEME_STORAGE_KEY","getSystemMode","mode","window","mql","matchMedia","matches","undefined","processState","state","callback","systemMode","getColorScheme","lightColorScheme","darkColorScheme","initializeValue","key","defaultValue","value","localStorage","getItem","setItem","e","useCurrentColorScheme","options","defaultMode","defaultLightColorScheme","defaultDarkColorScheme","supportedColorSchemes","modeStorageKey","colorSchemeStorageKey","storageWindow","joinedColorSchemes","join","setState","useState","initialMode","colorScheme","setMode","useCallback","currentState","newMode","setColorScheme","includes","console","error","newState","newLightColorScheme","light","newDarkColorScheme","dark","handleMediaQuery","mediaListener","useRef","current","useEffect","handler","media","addListener","removeListener","handleStorage","event","newValue","startsWith","match","endsWith","addEventListener","removeEventListener"],"sources":["/data/messenger.client/node_modules/@mui/system/esm/cssVars/useCurrentColorScheme.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { DEFAULT_MODE_STORAGE_KEY, DEFAULT_COLOR_SCHEME_STORAGE_KEY } from './getInitColorSchemeScript';\nexport function getSystemMode(mode) {\n  if (typeof window !== 'undefined' && mode === 'system') {\n    const mql = window.matchMedia('(prefers-color-scheme: dark)');\n    if (mql.matches) {\n      return 'dark';\n    }\n    return 'light';\n  }\n  return undefined;\n}\nfunction processState(state, callback) {\n  if (state.mode === 'light' || state.mode === 'system' && state.systemMode === 'light') {\n    return callback('light');\n  }\n  if (state.mode === 'dark' || state.mode === 'system' && state.systemMode === 'dark') {\n    return callback('dark');\n  }\n  return undefined;\n}\nexport function getColorScheme(state) {\n  return processState(state, mode => {\n    if (mode === 'light') {\n      return state.lightColorScheme;\n    }\n    if (mode === 'dark') {\n      return state.darkColorScheme;\n    }\n    return undefined;\n  });\n}\nfunction initializeValue(key, defaultValue) {\n  if (typeof window === 'undefined') {\n    return undefined;\n  }\n  let value;\n  try {\n    value = localStorage.getItem(key) || undefined;\n    if (!value) {\n      // the first time that user enters the site.\n      localStorage.setItem(key, defaultValue);\n    }\n  } catch (e) {\n    // Unsupported\n  }\n  return value || defaultValue;\n}\nexport default function useCurrentColorScheme(options) {\n  const {\n    defaultMode = 'light',\n    defaultLightColorScheme,\n    defaultDarkColorScheme,\n    supportedColorSchemes = [],\n    modeStorageKey = DEFAULT_MODE_STORAGE_KEY,\n    colorSchemeStorageKey = DEFAULT_COLOR_SCHEME_STORAGE_KEY,\n    storageWindow = typeof window === 'undefined' ? undefined : window\n  } = options;\n  const joinedColorSchemes = supportedColorSchemes.join(',');\n  const [state, setState] = React.useState(() => {\n    const initialMode = initializeValue(modeStorageKey, defaultMode);\n    const lightColorScheme = initializeValue(`${colorSchemeStorageKey}-light`, defaultLightColorScheme);\n    const darkColorScheme = initializeValue(`${colorSchemeStorageKey}-dark`, defaultDarkColorScheme);\n    return {\n      mode: initialMode,\n      systemMode: getSystemMode(initialMode),\n      lightColorScheme,\n      darkColorScheme\n    };\n  });\n  const colorScheme = getColorScheme(state);\n  const setMode = React.useCallback(mode => {\n    setState(currentState => {\n      if (mode === currentState.mode) {\n        // do nothing if mode does not change\n        return currentState;\n      }\n      const newMode = !mode ? defaultMode : mode;\n      try {\n        localStorage.setItem(modeStorageKey, newMode);\n      } catch (e) {\n        // Unsupported\n      }\n      return _extends({}, currentState, {\n        mode: newMode,\n        systemMode: getSystemMode(newMode)\n      });\n    });\n  }, [modeStorageKey, defaultMode]);\n  const setColorScheme = React.useCallback(value => {\n    if (!value) {\n      setState(currentState => {\n        try {\n          localStorage.setItem(`${colorSchemeStorageKey}-light`, defaultLightColorScheme);\n          localStorage.setItem(`${colorSchemeStorageKey}-dark`, defaultDarkColorScheme);\n        } catch (e) {\n          // Unsupported\n        }\n        return _extends({}, currentState, {\n          lightColorScheme: defaultLightColorScheme,\n          darkColorScheme: defaultDarkColorScheme\n        });\n      });\n    } else if (typeof value === 'string') {\n      if (value && !joinedColorSchemes.includes(value)) {\n        console.error(`\\`${value}\\` does not exist in \\`theme.colorSchemes\\`.`);\n      } else {\n        setState(currentState => {\n          const newState = _extends({}, currentState);\n          processState(currentState, mode => {\n            try {\n              localStorage.setItem(`${colorSchemeStorageKey}-${mode}`, value);\n            } catch (e) {\n              // Unsupported\n            }\n            if (mode === 'light') {\n              newState.lightColorScheme = value;\n            }\n            if (mode === 'dark') {\n              newState.darkColorScheme = value;\n            }\n          });\n          return newState;\n        });\n      }\n    } else {\n      setState(currentState => {\n        const newState = _extends({}, currentState);\n        const newLightColorScheme = value.light === null ? defaultLightColorScheme : value.light;\n        const newDarkColorScheme = value.dark === null ? defaultDarkColorScheme : value.dark;\n        if (newLightColorScheme) {\n          if (!joinedColorSchemes.includes(newLightColorScheme)) {\n            console.error(`\\`${newLightColorScheme}\\` does not exist in \\`theme.colorSchemes\\`.`);\n          } else {\n            newState.lightColorScheme = newLightColorScheme;\n            try {\n              localStorage.setItem(`${colorSchemeStorageKey}-light`, newLightColorScheme);\n            } catch (error) {\n              // Unsupported\n            }\n          }\n        }\n        if (newDarkColorScheme) {\n          if (!joinedColorSchemes.includes(newDarkColorScheme)) {\n            console.error(`\\`${newDarkColorScheme}\\` does not exist in \\`theme.colorSchemes\\`.`);\n          } else {\n            newState.darkColorScheme = newDarkColorScheme;\n            try {\n              localStorage.setItem(`${colorSchemeStorageKey}-dark`, newDarkColorScheme);\n            } catch (error) {\n              // Unsupported\n            }\n          }\n        }\n        return newState;\n      });\n    }\n  }, [joinedColorSchemes, colorSchemeStorageKey, defaultLightColorScheme, defaultDarkColorScheme]);\n  const handleMediaQuery = React.useCallback(e => {\n    if (state.mode === 'system') {\n      setState(currentState => _extends({}, currentState, {\n        systemMode: e != null && e.matches ? 'dark' : 'light'\n      }));\n    }\n  }, [state.mode]);\n\n  // Ref hack to avoid adding handleMediaQuery as a dep\n  const mediaListener = React.useRef(handleMediaQuery);\n  mediaListener.current = handleMediaQuery;\n  React.useEffect(() => {\n    const handler = (...args) => mediaListener.current(...args);\n\n    // Always listen to System preference\n    const media = window.matchMedia('(prefers-color-scheme: dark)');\n\n    // Intentionally use deprecated listener methods to support iOS & old browsers\n    media.addListener(handler);\n    handler(media);\n    return () => media.removeListener(handler);\n  }, []);\n\n  // Handle when localStorage has changed\n  React.useEffect(() => {\n    const handleStorage = event => {\n      const value = event.newValue;\n      if (typeof event.key === 'string' && event.key.startsWith(colorSchemeStorageKey) && (!value || joinedColorSchemes.match(value))) {\n        // If the key is deleted, value will be null then reset color scheme to the default one.\n        if (event.key.endsWith('light')) {\n          setColorScheme({\n            light: value\n          });\n        }\n        if (event.key.endsWith('dark')) {\n          setColorScheme({\n            dark: value\n          });\n        }\n      }\n      if (event.key === modeStorageKey && (!value || ['light', 'dark', 'system'].includes(value))) {\n        setMode(value || defaultMode);\n      }\n    };\n    if (storageWindow) {\n      // For syncing color-scheme changes between iframes\n      storageWindow.addEventListener('storage', handleStorage);\n      return () => storageWindow.removeEventListener('storage', handleStorage);\n    }\n    return undefined;\n  }, [setColorScheme, setMode, modeStorageKey, colorSchemeStorageKey, joinedColorSchemes, defaultMode, storageWindow]);\n  return _extends({}, state, {\n    colorScheme,\n    setMode,\n    setColorScheme\n  });\n}"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,wBAAwB,EAAEC,gCAAgC,QAAQ,4BAA4B;AACvG,OAAO,SAASC,aAAa,CAACC,IAAI,EAAE;EAClC,IAAI,OAAOC,MAAM,KAAK,WAAW,IAAID,IAAI,KAAK,QAAQ,EAAE;IACtD,MAAME,GAAG,GAAGD,MAAM,CAACE,UAAU,CAAC,8BAA8B,CAAC;IAC7D,IAAID,GAAG,CAACE,OAAO,EAAE;MACf,OAAO,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